package com.example.myapplication.demo;

import com.example.myapplication.User;
import com.google.gson.Gson;

import javax.inject.Singleton;

import dagger.Module;
import dagger.Provides;

/**
 * Created by ly on 2016/10/10 11:15.
 */
@Module  // TODO: 2016/10/10 注意
public class MainModule {

    @Provides
    public Gson provideGson() {
        return new Gson();
    }

    @Provides
    @Singleton
    public Poetry providePoetry(String str, User user) {
        return new Poetry(str, user);
    }

    @Singleton
    @Provides
    public String provideStr() {
        return "爱哥哥";
    }

    @Singleton
    @Provides
    public User provideUser() {
        User user = new User();
        user.name = "乌拉拉";
        user.id = 8;
        return user;
    }
}
